﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;

namespace TwitterLikeWebChatWcfService
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IService1" in both code and config file together.
    [ServiceContract]
    public interface ITwitter
    {
        [OperationContract]
        [WebInvoke(Method = "GET")]
        string[] GetChannelNames();

        [OperationContract]
        [WebInvoke(Method = "GET", UriTemplate = "Messages/{channelName}")]
        MessageDTO[] GetMessagesByChannelName(string channelName);

        [OperationContract]
        [WebInvoke(Method = "GET", UriTemplate = "Messages/{channelName}/{maxMessagesCountString}")]
        MessageDTO[] GetLastNMessagesByChannelName(string channelName, string maxMessagesCountString);
     
        [OperationContract]
        [WebInvoke(Method = "POST", RequestFormat = WebMessageFormat.Json)]
        void DeleteAllMessagesByChannelName(string channelName);

        [OperationContract]
        [WebInvoke(Method = "POST", RequestFormat = WebMessageFormat.Json)]
        void UploadMessageByChannelName(MessageDTO messageDTO);

        [OperationContract]
        [WebInvoke(Method = "POST", RequestFormat = WebMessageFormat.Json)]
        void CreateNewChannel(string channelName);

        [OperationContract]
        [WebInvoke(Method = "POST", RequestFormat = WebMessageFormat.Json)]
        void DeleteChannel(string channelName);
    }
}